import lrz from 'lrz'
/**
 * lrz压缩
 * @param file
 * @param width
 * @returns {Promise<any>}
 */
export default function lrzCompress(file, width) {
  return new Promise((resolve, reject) => {
    lrz(file, {width: width, fieldName: 'file'}).then(data => {
      // console.log(data)
      resolve(data)
    }).catch(error => {
      reject(error)
    })
  })
}